import React from 'react';
var NavLink = require('./NavLink')
class Album extends React.Component{
    render(){
        var arr=[];
        var arr1=[];
        var dd={};
        var ddd={};
        $.ajax({
            url: 'http://10.31.160.51/react/data.php',
            type: 'get',
            async:false,
            dataType: 'json',
            success:function(data){
              
                dd = data[3];
                ddd = data[4];
            }
        })
  
        for(var i=0;i<dd.length;i++){
            arr.push(<li>
                    <div className="u-cover u-cover-alb2">
                        <img src={dd[i].img}/>
                        <NavLink to={dd[i].url} className="msk" title={dd[i].name}></NavLink>
                        <a href="javascript:;" className="icon-play f-alpha f-fr" title="播放" data-res-type="19" data-res-id="3367888" data-res-action="play"></a>
                    </div>
                    <p className="dec"><a className="tit f-thide s-fc0" href="/album?id=3367888" title={dd[i].name}>{dd[i].name}</a></p>
                    <p className="f-thide"><span className="nm f-thide" title={dd[i].geshou}><a className="s-fc3" href={dd[i].url}>{dd[i].geshou}</a></span></p>
                </li>)
        };
        for(var i=0;i<ddd.length;i++){
            arr1.push(
                 <li>
                    <div className="u-cover u-cover-alb2">
                        <img src={ddd[i].img}/>
                        <NavLink to={ddd[i].url} className="msk" title={ddd[i].name}></NavLink>
                        <a href="javascript:;" className="icon-play f-alpha f-fr" title="播放" data-res-type="19" data-res-id="3367888" data-res-action="play"></a>
                    </div>
                    <p className="dec"><a className="tit f-thide s-fc0" href="/album?id=3367888" title={ddd[i].name}>{ddd[i].name}</a></p>
                    <p className="f-thide"><span className="nm f-thide" title={ddd[i].geshou}><a className="s-fc3" href={ddd[i].url}>{ddd[i].geshou}</a></span></p>
                </li>
                )
        };

        return(
            <div className = "g-bd">
                <div className="g-wrap n-alblist f-pr">
                    <div className="u-title f-cb">
                        <h3><span className="f-ff2">热门新碟</span></h3>
                    </div>
                    <ul className="m-cvrlst m-cvrlst-alb2 f-cb">

                        {arr}
                        
                    </ul>
                    <div className="u-title f-cb" id="allAlbumList">
                        <h3><span className="f-ff2">全部新碟</span></h3>
                        <div className="tab" id="areaList">
                            <a href="/discover/album/#/?area=ALL" className="s-fc6" id="auto-id-6C2Z1LgotZFG0xGt">全部</a><span className="line">|</span>
                            <a href="/discover/album/#/?area=ZH" className="s-fc3" id="auto-id-avnG2sJDWGTqclfZ">华语</a><span className="line">|</span>
                            <a href="/discover/album/#/?area=EA" className="s-fc3" id="auto-id-lV176xcz1fmXdQKf">欧美</a><span className="line">|</span>
                            <a href="/discover/album/#/?area=KR" className="s-fc3" id="auto-id-wRmNgBb2TA3cZKla">韩国</a><span className="line">|</span>
                            <a href="/discover/album/#/?area=JP" className="s-fc3" id="auto-id-uuqNxTVJUgfH9V7l">日本</a>
                        </div>
                    </div>
                    <ul className="m-cvrlst m-cvrlst-alb2 f-cb">

                        {arr1}
                    </ul>
                    <ul className="pagination">
                        <li><a href="#">&laquo;</a></li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li><a href="#">&raquo;</a></li>
                    </ul>
                </div>
            </div>
         
        )
    }
}

module.exports= Album;